package cal.lib.test;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.DisplayMetrics;
import cal.lib.dashboard.DashboardExtended;
import cal.lib.dashboard.test1;
import cal.lib.dashboard.test2;

import com.cilheo.R;

public class Main extends Activity /*implements OnItemClickListener*/ {

	int itemMenu1;
	int itemMenu2;
	int itemMenu3;
	int itemMenu4;
	int itemMenu5;
	
	
	
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
		DisplayMetrics metrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(metrics);
		
		int widthSize=(int)metrics.widthPixels;
        
//        Dashboard dash=new Dashboard(this, widthSize);
////        dash.setBackgroundColor(Color.CYAN);
//        dash.setBackgroundResource(R.drawable.bgand);
//        
//        
//        dash.addBanier(R.drawable.bn1);
//        dash.addSeparator(R.drawable.sep);
//        
//        itemMenu1=dash.addItemToDashboard(R.drawable.t1, "super moche", Color.BLACK);
//        itemMenu2=dash.addItemToDashboard(R.drawable.t1, "super moche", Color.BLACK);
//        itemMenu3=dash.addItemToDashboard(R.drawable.t2, "super bien", Color.BLACK);
//        itemMenu4=dash.addItemToDashboard(R.drawable.t2, "super bien", Color.BLACK);
//        itemMenu5=dash.addItemToDashboard(R.drawable.t1, "super moche", Color.BLACK);
//        setContentView(dash.build());
//
//    
//        dash.setOnItemClick(this);
		
		//On cree le dashboard etendu
		DashboardExtended dbe = new DashboardExtended(this, widthSize);
		
		//On cree l'intent du premier item et on l'ajoute au dashboard
		Intent theIntent = new Intent(this, test1.class);
		dbe.addItemToDashboard(R.drawable.t1, "Item 1", Color.CYAN, theIntent);
		//On cree l'intent du second item et on l'ajoute au dashboard
		theIntent = new Intent(this, test2.class);
		dbe.addItemToDashboard(R.drawable.t2, "Item 2", Color.CYAN, theIntent);
		setContentView(dbe.build());
    
    }

//	@Override
//	public void onItemClick(AdapterView<?> parent, View v, int pos, long id) {
//		if(v.getId()==itemMenu1){
//			setContentView(R.layout.main);
//		}
//	}
}